package chess;

public class Move {

	private static String[] letters = {"a", "b", "c", "d", "e", "f", "g", "h"};
	private int _fromFile, _toFile, _fromRank, _toRank;

	public Move(int fromFile, int fromRank, int toFile, int toRank) {
		_fromFile = fromFile;
		_fromRank = fromRank;
		_toFile = toFile;
		_toRank = toRank;
	}

	public int fromFile() {
		return _fromFile;
	}

	public int fromRank() {
		return _fromRank;
	}

	public int toFile() {
		return _toFile;
	}

	public int toRank() {
		return _toRank;
	}

	public int dFile() {
		return _toFile - _fromFile;
	}

	public int dRank() {
		return _toRank - _fromRank;
	}

	public String toString() {
		return (letters[_fromFile] + (_fromRank + 1) + "-" + letters[_toFile] + (_toRank + 1));
	}
}
